package com.changgou.content.feign;

import com.changgou.content.pojo.Content;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 广告微服务content的feign通信接口
 * @author zhengjd
 * @date 2020/5/7 23:54
 */
@FeignClient(name = "content")  //设置feign的微服务注册名称
@RequestMapping("/content")
public interface ContentFeign {

    /**
     * 根据分类Id查询Content数据
     * @param id
     * @return
     */
    @GetMapping("list/category/{id}")
    Result<List<Content>> findByCategoryId(@PathVariable(name = "id") Long id);
}
